﻿package h.ku.utils{	import flash.display.*;	import flash.utils.getDefinitionByName;		import h.ku.eval.Args;	import h.ku.lang.hkuObject;	import h.ku.lang.modules.*;	import h.ku.lang.modules.xml.*;

	public class EnvironmentBuilder	{				public static function buildEnvironment(t:String="<topLevel>",modules:Array=null):hkuObject		{			var obj:hkuObject = new hkuObject(t)			obj.addAS3Function("Object",function(a:Args):void			{				a.caller.finishFunctionEval(new hkuObject("<createdObject>"))			})			obj.setProperty("Math",new hkuMath())			obj.setProperty("Net",new Net())			obj.setProperty("JSON",new JSON())			obj.setProperty("XML",new hkuXMLModule())			obj.setProperty("Timer",new hkuTimer())			obj.setProperty("$",obj)			obj.setProperty("display",				{					MovieClip:function(...args):MovieClip					{						return new MovieClip()					}				})							return obj		}	}}